﻿/// <reference path="jquery.min.js" />
/// <reference path="rsseasy.min.js" />
/// <reference path="rsseasy.app.js" />
/// <reference path="validated.v2.min.js" />


$(function () {
    var feeipt = $("#recharge_form input[type='number']"), paychannelipt = $("#recharge_form [name='channelid']");
    $("#recharge_form>button").click(function () {
        try {
            ValidatedV2.valset(feeipt.val()).isMoney().valset(paychannelipt.val()).isNumber();
            var params = { "fee": feeipt.val(), "channelid": paychannelipt.val() };
            location.href =RssApp.WwwHost+ "api/pay/recharge?myid=" + RssUser.Data.myid + "&fee=" + params.fee + "&channelid=" + params.channelid + "&sourceid=1";
        }
        catch (ex) {
            RssCode.alert(ex);
        }
    });


    $("#recharge_form span input").click(function () {
        feeipt.val(parseInt(this.value));
    });

});